import { OptionUtils } from '@r-magician/utils';

export const UserStatus = OptionUtils.createEnum({
  ENABLED: 1,
  DISABLED: 0,
});

export const userStatusOptionns = OptionUtils.createOptions([
  { label: '正常', value: UserStatus.ENABLED },
  { label: '禁用', value: UserStatus.DISABLED },
]);

export const MenuType = OptionUtils.createEnum({
  MENU: 'menu',
  BUTTON: 'button',
  OTHER: 'other',
});

export const menuTypeOptions = OptionUtils.createOptions([
  { label: '菜单', value: MenuType.MENU },
  { label: '按钮', value: MenuType.BUTTON },
  { label: '其他', value: MenuType.OTHER },
]);

export const MenuEnum = OptionUtils.createEnum([
  'USER_MANAGE',
  'ROLE_MANAGE',
  'AUTH_MANAGE',
]);

export const menuOptions = OptionUtils.createOptions([
  { label: '用户管理', value: MenuEnum.USER_MANAGE },
  { label: '角色管理', value: MenuEnum.ROLE_MANAGE },
  { label: '权限管理', value: MenuEnum.AUTH_MANAGE },
]);

export const ButtonEnum = OptionUtils.createEnum([
  'UPDATED_USER',
  'SET_SUPER_ADMIN',
  'ENABLE_USER',
  'DELETE_USER',
  'DISABLE_USER',
  'RECYCLE_SUPER_ADMIN',
  'RESET_PASSWORD',
  'CREATE_USER',
  'REMOVE_ROLE',
  'CREATE_ROLE',
  'ROLE_AUTHORIZATION',
  'UPDATE_ROLE',
  'UPDATE_MENU',
  'REMOVE_MENU',
  'CREATE_MENU',
  'REMOVE_SYSTEM',
  'CREATE_SYSTEM',
  'UPDATE_SYSTEM',
]);

export const buttonOptions = OptionUtils.createOptions([
  { label: '更新用户', value: ButtonEnum.UPDATED_USER },
  { label: '设为超管', value: ButtonEnum.SET_SUPER_ADMIN },
  { label: '启用用户', value: ButtonEnum.ENABLE_USER },
  { label: '删除用户', value: ButtonEnum.DELETE_USER },
  { label: '禁用用户', value: ButtonEnum.DISABLE_USER },
  { label: '回收超管', value: ButtonEnum.RECYCLE_SUPER_ADMIN },
  { label: '重置密码', value: ButtonEnum.RESET_PASSWORD },
  { label: '创建用户', value: ButtonEnum.CREATE_USER },
  { label: '删除角色', value: ButtonEnum.REMOVE_ROLE },
  { label: '创建角色', value: ButtonEnum.CREATE_ROLE },
  { label: '角色授权', value: ButtonEnum.ROLE_AUTHORIZATION },
  { label: '编辑角色', value: ButtonEnum.UPDATE_ROLE },
  { label: '编辑菜单', value: ButtonEnum.UPDATE_MENU },
  { label: '删除菜单', value: ButtonEnum.REMOVE_MENU },
  { label: '新增菜单', value: ButtonEnum.CREATE_MENU },
  { label: '删除系统', value: ButtonEnum.REMOVE_SYSTEM },
  { label: '新建系统', value: ButtonEnum.CREATE_SYSTEM },
  { label: '编辑系统', value: ButtonEnum.UPDATE_SYSTEM },
]);
